package com.cyk.comicforumjava.demos.web;

import com.cyk.comicforumjava.demos.base.ResponseResult;
import com.cyk.comicforumjava.demos.dto.UserDto;
import com.cyk.comicforumjava.demos.service.MessageService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RestController
@RequestMapping("/Message")
public class MessageController {
    @Autowired
    MessageService messageService;
    @GetMapping("/PostList/{userId}")
    public ResponseResult postList(@PathVariable Long userId){
        ResponseResult responseResult = messageService.postList(userId);
        return responseResult;
    }
    @GetMapping("/SupportList/{userId}")
    public ResponseResult supportList(@PathVariable Long userId){
        ResponseResult responseResult = messageService.supportList(userId);
        return responseResult;
    }
    @GetMapping("/MyBackList/{userId}")
    public ResponseResult myBackList(@PathVariable Long userId){
        ResponseResult responseResult = messageService.myBackList(userId);
        return responseResult;
    }
    @PostMapping("/getUserChat")
    public ResponseResult getUserChat(@RequestBody UserDto userDto){
        ResponseResult responseResult = messageService.getUserChat(userDto);
        return responseResult;
    }
}
